<script type="text/javascript" src="${base}/scripts/htgl/cght_detail.js"></script>
<div id="cght_tabs" detail="true" class="easyui-tabs" data-options="fit:true,border:false">
<div title="合同信息">
    <table style="width: 100%" class="tb tab-t t-bor">
        <input type="hidden" name="cght.name.id" id="cght_id" value="${(cght.id)!}"/>
        <input type="hidden" name="htdy.name.id" id="htdy_id" value="${(htdyId)!''}"/>
        <col width="90px"/>
        <col width=""/>
        <col width="90px"/>
        <col width=""/>
        <col width="120px"/>
        <col width=""/>
        <tr>
            <th>合&nbsp;同&nbsp;&nbsp;号：</th>
            <td>
            ${(cght.htbm)!}
            </td>
        <#--<#if cght?? && cght.cglx=='zddh'>-->
            <th style="font-weight: bold">销售合同：</th>
            <td colspan="3">
            <#if cght?? && cght.zddhxshtList??>
                <#list cght.zddhxshtList as zddhxsht>
                    <a href="javascript:void(0)"
                       onclick="viewZddhCgDetail('${(zddhxsht.id)!}')">${(zddhxsht.htbm)!}</a>&nbsp;&nbsp;
                </#list>
            </#if>
            </td>
        <#--</#if>-->
        </tr>
        <tr>
            <th>路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径：</th>
            <td colspan="5">
                <span class="ljtip">${(cght.lj.mc)!}</span>
            </td>
            <input id="cghtgl_detail_ljtip" value="${(cght.lj.id)!}" type="hidden"/>
            <input id="cghtgl_detail_ljlx" value="${(cght.lj.lx)!}" type="hidden"/>
        </tr>
        <tr>
            <th>物资计划：</th>
            <td>
            <#--<a href="javascript:void(0);" onclick="viewCghtWzjhDetail('${(cght.bgjhhz.id)!}','${(wzjhType)!}');">-->
                <span>${(cght.bgjhhz.bm)!}</span>
            <#--</a>-->
            </td>
            <th>合同类型：</th>
            <td>
            <#if cght??>
                <#if cght.cglx=='cgrk'>采购入库<#elseif cght.cglx=='tpcght'>统配合同<#elseif cght.cglx=='bght'>保供合同<#else>
                    直达到货</#if>
            </#if>
            </td>

            <th>供应商：</th>
            <td>
            ${(cght.hzf.qc)!}
            </td>
        </tr>
        <tr>
            <th>签订日期：</th>
            <td>
            ${(cght.qdrq?date)!}
            </td>
            <th>签订地点：</th>
            <td>
            ${(cght.qddd)!}
            </td>
            <th>投资付款时间：</th>
            <td>
            ${(cght.fksj?date)!}
            </td>
        <#--  <th>付款方式：</th>
          <td>
          ${(cght.fkfs.bz)!}
          </td>-->
        </tr>
        <tr>
            <th>预交货时间：</th>
            <td>
            ${(cght.jhsj?date)!}
            </td>
            <th>交货地点：</th>
            <td>
            ${(cght.jhdd)!}
            </td>

            <th>交货方式：</th>
            <td>
            ${(cght.jhfs)!}
            </td>
        </tr>
     <#--   <tr>
        <#if (yg.zgjg.sfxyjz)?exists && !yg.zgjg.sfxyjz>
        &lt;#&ndash;  <th>质押方：</th>
          <td>
              ${(cght.zyf.jc)!}
          </td>&ndash;&gt;
        </#if>
            <th>价格是否相同：</th>
            <td colspan="3">
                <#if cght??&&cght.jgsfxt??>
                    <#if cght.jgsfxt=='1'>相同<#else>不相同</#if>
                    &nbsp;&nbsp;&nbsp;&nbsp;（说明：判断采购合同价和实际结算价是否相同）
                </#if>
            </td>
        &lt;#&ndash;<th>结束日期：</th>&ndash;&gt;
        &lt;#&ndash;<td>&ndash;&gt;
        &lt;#&ndash;${(cght.jsrq?date)!}&ndash;&gt;
        &lt;#&ndash;</td>&ndash;&gt;
        &lt;#&ndash;<th>合同性质：</th>&ndash;&gt;
        &lt;#&ndash;<td>&ndash;&gt;
        &lt;#&ndash;${(cght.htxz.bz)!}&ndash;&gt;
        &lt;#&ndash;</td>&ndash;&gt;
        </tr>-->
        <tr>
            <th>申报公司：</th>
            <td>
            ${(cght.sbgs.jc)!}
            </td>
           <#-- <th>申报部门：</th>
            <td>
            ${(cght.sbbm.qc)!}
            </td>-->
            <th>申报人：</th>
            <td>
            ${(cght.sbr.xm)!}
            </td>
            <th>税率(%)：</th>
            <td>
            ${(cght.sl?string(",##0.0000"))!}
            </td>
        </tr>
        <tr>
            <th>总部采购：</th>
            <td><#if cght?? && cght.zbcg?? && cght.zbcg>是<#else>否</#if></td>
            <th>采购公司：</th>
            <td>
            ${(cght.wlfgs.qc)!}
            </td>
            <th>现金优惠(%)：</th>
            <td>
            ${(cght.yhbl?string(",##0.000000"))!}
           <#-- ${(cght.yhbl)!}-->
            </td>
        </tr>
        <tr>
            <th>免息天数：</th>
            <td>${(cght.mxts)!}</td>
            <th>月贴息率(%)：</th>
            <td>
            ${(cght.txl)!}
            </td>
            <th>来源系统合同号：</th>
            <td>
            ${(cght.xsxt_htbm)!}
            </td>
        </tr>
        <tr>
            <th>保证金方式：</th>
            <td>
            <#if cght.bzjfs??>
                <#if cght.bzjfs==0>一次性使用<#elseif cght.bzjfs==1>按比例使用<#elseif cght.bzjfs==2>无保证金<#else>
                    无</#if>
                <#else>
                   无
            </#if>
            </td>
        </tr>
        <tr>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="5">
            ${(cght.bz)!}
            </td>
        </tr>

        <tr>
            <th>附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件：</th>
            <td class="lian" colspan="5">
            <#if cght?? && cght.fjList??>
                <#list cght.fjList as fj>
                    <span class="uploadify-queue-item fileName" style="height:65px;text-align: center;">
                            <a href="${base}/base/fj/downLoadFj?fjId=${fj.id}" class="previewImg"
                               rel="previewImg_${(cght.id)!}" title="${(fj.ccmc)!}"
                               style="display:block;margin: 0 auto;">
                                <img src="${base}/base/fj/downLoadFj?fjId=${fj.id}" width="50" height="50"/>
                            </a>
                        <a href="javascript:void(0);"
                           onclick="window.location.href='${base}/base/fj/downLoadFj?fjId=${fj.id}'">下载
                        </a>
                        </span>
                </#list>
            </#if>
            </td>
        </tr>
        <tr>
            <th>是否后定价：</th>
            <td><#if cght.sfhdj?? && cght.sfhdj>是<#else>否</#if></td>
            <th>制&nbsp;单&nbsp;&nbsp;人：</th>
            <td>${(cght.createUser.xm)!}</td>
            <th>制单时间：</th>
            <td>${(cght.dateCreated?datetime)!}</td>
        </tr>
    </table>

</div>
<div title="合同明细">
    <div id="cghtmx_detail_toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><a href="javascript:void(0);" name="exp" class="undo" plain="true">导出</a></li>
            </ul>
        </div>
    </div>
    <table id="cght_cghtmx_table" class="easyui-datagrid"
           url="${base}/htgl/cghtgl/cghtgldetail_htmx?cghtId=${(cght.id)!}" toolbar="#cghtmx_detail_toolbar"
           rownumbers="true" fit="true" fitColumns="true" pagination="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'xsxt_xsdh',width:100,align:'right'">销售系统子项号</th>
            <th data-options="field:'wzgg.name',width:100,align:'center'">物资名称</th>
            <th data-options="field:'wzgg.ggxh',width:100,align:'center'">规格型号</th>
            <th data-options="field:'wzgg.cz',width:30,align:'center'">材质</th>
            <th data-options="field:'wzgg.dw',width:40,align:'center'">单位</th>
            <th data-options="field:'cd.z',width:70,align:'center'">产地</th>
            <th data-options="field:'js',width:70,align:'right',formatter:formatSlForHtml">件数</th>
            <th data-options="field:'sbsl',width:70,align:'right',formatter:formatSlForHtml">重量</th>
            <th data-options="field:'jzfs.z',width:40,align:'center'">记重方式</th>
                <th data-options="field:'spec',width:70,align:'right'">特点</th>
            <th data-options="field:'hsj',width:70,formatter:formatJeForHtml,align:'right'">含税单价</th>
            <th data-options="field:'bhsj',width:70,formatter:formatJeForHtml,align:'right'">不含税单价</th>
            <th data-options="field:'hsje',width:70,align:'right',formatter:formatJeForHtml2">含税总金额</th>

        </tr>
        </thead>
    </table>
</div>
<div title="采购记录">
    <table id="cght_cgjl_table" class="easyui-datagrid" url="${base}/cggl/cgdgl/cgjlList?cghtId=${(cght.id)!}"
           rownumbers="true" fit="true" fitColumns="true" pagination="true">
        <thead>
        <tr>
            <th data-options="field:'cgdh',width:60,align:'center'">采购单号</th>
            <th data-options="field:'fhrq',width:30,align:'center'">发货日期</th>
            <th data-options="field:'gys_qc',width:60,align:'center'">供应商名称</th>
            <th data-options="field:'cglx',width:20,align:'center'">采购类型</th>
            <th data-options="field:'sbgs_qc',width:60,align:'center'">申报公司</th>
        <#--<th data-options="field:'sbbm_qc',width:25,align:'center'">申报部门</th>-->
            <th data-options="field:'sbr_xm',width:10,align:'center'">申报人</th>
        </tr>
        </thead>
    </table>
</div>
<div title="付款记录">
    <table id="cght_fkjl_table" class="easyui-datagrid" url="${base}/sfgl/fksh/fkshByCghtList?cghtId=${(cght.id)!}"
           rownumbers="true" fit="true" fitColumns="true" pagination="true">
        <thead>
        <tr>
            <th data-options="field:'bm',width:40,align:'center'">单据号</th>
            <th data-options="field:'sfklx',width:15,align:'center'">付款类型</th>
            <th data-options="field:'gldw_jc',width:30,align:'center'">关联企业</th>
            <th data-options="field:'sfje',width:60,formatter:formatJeForHtml2,align:'right'">付款总金额</th>
            <th data-options="field:'kxlx',width:15,align:'center'">款项类型</th>
            <th data-options="field:'pjlx_z',width:20,align:'center'">票据类型</th>
            <th data-options="field:'sbgs_jc',width:25,align:'center'">申报公司</th>
            <th data-options="field:'sbr_xm',width:20,align:'center'">申报人</th>
            <th data-options="field:'bz',width:15,align:'center'">备注</th>
        </tr>
        </thead>
    <#--{field: 'sfklx', title: '付款类型', width: 15,-->
    <#--formatter: function (value) {-->
    <#--if (value == '1')-->
    <#--return '供应付款';-->
    <#--else-->
    <#--return '销售退款';-->
    <#--}},-->
    <#--formatter: function (value) {-->
    <#--if (value == '1')-->
    <#--return '应付款';-->
    <#--else-->
    <#--return '预付款';-->
    <#--}-->
    <#--},-->
    </table>
</div>
<#--<div title="付款方式">-->
<#--<table class="easyui-datagrid" url="${base}/htgl/cghtgl/cght_fkfsList?cghtId=${(cght.id)!}"-->
<#--rownumbers="true" fit="true" fitColumns="true" pagination="true">-->
<#--<thead>-->
<#--<tr>-->
<#--<th data-options="field:'fksj',width:30,align:'center'">发票进账后几个月应付</th>-->
<#--<th data-options="field:'fkbl',width:10,align:'right'">比例(%)</th>-->
<#--<th data-options="field:'isyf',width:10,align:'right',formatter:function(v){-->
<#--return v ? '是' : '否';-->
<#--}">是否预付款-->
<#--</th>-->
<#--</tr>-->
<#--</thead>-->
<#--</table>-->
<#--</div>-->
<div title="合同文本" style="overflow:hidden">
    <div id="-toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><a class="she" href="javascript:void(0);" onclick="checkIsInstall('CGHT_')">检查插件</a></li>
                <li><a class="watch" href="javascript:void(0);"
                       onclick="printPreview('CGHT_','${(cghtHtbm)!}','${(cghtEmwtime)!}')">打印</a></li>
            <#--<li><a class="pen" href="javascript:void(0);"-->
            <#--onclick="print('CGHT_','${(cghtHtbm)!}','${(cghtEmwtime)!}')">打印</a></li>-->
            </ul>
        </div>
    </div>

    <div style="overflow:auto;height:90%">
        <object id="CGHT_LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
            <embed id="CGHT_LODOP_EM" type="application/x-print-lodop" width=0 height=0
                   pluginspage="install_lodop32.exe"></embed>
        </object>
        <div id="htwb_cght_detail_id" class="textcon"></div>
    </div>
</div>
</div>